﻿@model DLM.Web.ViewModel.UserCenterPageView
@{
    ViewBag.Title = "账户中心";
    Layout = "~/Views/Shared/_Master.cshtml";
}
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script type="text/javascript" src="@Url.Content("~/Scripts/jquery.form.js")"></script>
<script type="text/javascript" src="@Url.Content("~/Scripts/jquery.fancybox-1.3.4.pack.js")"></script>
<link rel="stylesheet" type="text/css" href="@Url.Content("~/Content/css/jquery.fancybox-1.3.4.css")" media="screen" />
<script type="text/javascript">
    $(document).ready(function () {
        var options = {
            target: '#divMessage',
            success: showResponse

        };
        $('#filePost').submit(function () {
            $(this).ajaxSubmit(options);
            return false;
        });

        $(":checkbox").change(function () {
            if ($(":checkbox").attr("checked")) {
                $("#hdIsDelete").val("True");

            } else {
                if ($("#hdIsDelete") != null) {
                    $("#hdIsDelete").val("");
                }

            }
        });
    });


    function showRequest(formData, jqForm, options) {

        return true;
    }
    function showResponse(responseText, statusText) {
        //alert(responseText);
        if (responseText != "您上传的照片格式不符合要求,请上传jpg格式的图片"
        && responseText != "请选择要上传的照片"
        && responseText != "用户最多允许上传四张相片") {

            $("#divPhoto").html("");

        } else {
            $("#divMessage").html("");
             ShowDialogMessage('warn', responseText);

            $("#divPhoto").load("@Url.Action("GetAlbum", new { id = Model.User.UserID })");
            
        }
        

    }

    function handleError(responseText, statusText) {
        alert(statusText);
        alert(responseText);
    }

            function showPhoto(obj){
            $(obj).fancybox({
				'opacity'		: true,
				'overlayShow'	: false,
				'transitionIn'	: 'elastic',
				'transitionOut'	: 'elastic'
                });
            return false;
        }


         function stopBubble(e) {  
     if (e && e.stopPropagation) {//非IE  
         e.stopPropagation();  
     }  
     else {//IE  
         window.event.cancelBubble = true;  
     }  
 } 
</script>
<div class="main">
    <div class="main_tab_2">
        <div class="main_tab_2_up">
            <ul>
                <li class="current"><a href="#">个人资料</a></li>
                <li><a href="#">账户信息</a></li>
                <li><a href="#">积分信息</a></li>
            </ul>
        </div>
        <div class="main_tab_2_down">
            <div class="box">
                @{Html.RenderPartial("_UserInfo", Model.User);}
                @using (Html.BeginForm("Upload", "User", new { id = Model.User.UserID }, FormMethod.Post, new { enctype = "multipart/form-data", id = "filePost" }))
                {
        
            

               
                    <div id="divMessage">
                    </div>
                
                    <div id="divPhoto">
                        @{ Html.RenderPartial("_Photo", Model.UserPhotos); }
                    </div>

                }
            </div>
            <div class="box" style="display: none;">
                @{Html.RenderPartial("_AccountInfo", Model.Account);}
            </div>
            <div id="divLog" class="box" style="display: none;">
                @{ Html.RenderPartial("_BonusInfo", Model.BonusView); }
            </div>
        </div>
    </div>
</div>
